  <script type="text/javascript">
  $(document).ready(function(){
	  $("#inputForm .score").focus(function(){
	        $("#inputForm .score").removeClass('focus');
	        $(this).addClass('focus');
	       });

	  $("#inputTitle").html($("#sn option:selected").text()+$("#stage_id option:selected").text());

	   $("#inputForm #signBtn").click(function(){
		   $(this).attr('disabled','disabled');
		   $("#signForm").submit();
	   });

	   $("#signForm").ajaxForm( {
		   success: function(){
		 //  $("#dialog").dialog('close');
		   $("#stage_id").trigger('change');
		   }
		});
  });
  </script>
<style>
.focus {background:#ff0}
</style>
  <h3 id="inputTitle"></h3>

  <div id="inputForm">
    <form  method="post"  id="signForm" action="<?php echo $this->route('sign')?>">
    <input type="hidden" name="sn" value="<?php echo $this->sn?>" />
    <input type="hidden" name="stage" value="<?php echo $this->stage?>" />
    <input type="hidden" name="test_order" value="<?php echo $this->test_order?>" />
    <table>
    <thead>
    </thead>
    <tbody>
     <?php $i=0?>
    <?php foreach($this->students as $studentSn=>$val):?>
    <?php if ($i % 3 == 0):?><tr><?php endif?>
    <td><?php echo $val['number']?></td>
    <td><?php echo $val['name']?></td>
    <td><input type="text"  class="score" id="s-<?php echo $studentSn?>" size="3"  tabindex="<?php echo 100+$i?>"
    name="score[<?php echo $val['sn']?>]"
     value="<?php if(isset($this->scores[$studentSn]))echo $this->scores[$studentSn]?>"></td>
    <?php if ($i++ % 3 == 2):?></tr><?php endif?>
    <?php endforeach?>
    </tbody>
    </table>
     <input type="button"  id="signBtn" value="<?php echo $this->translate('sign')?>" />
    <label for="test_name"><?php echo $this->translate('test name')?> :</label>
    <input type="text"  id="test_name"  name="test_name"  size="6" value="<?php echo $this->testName?>"  />
    <label for="weighted"><?php echo $this->translate('weighted')?> :</label>
    <input type="text"  id="weighted"  name="weighted"  size="2" value="<?php echo $this->weighted?>" />

    </form>
    </div>
